package io.xiaojl.xj2ee.modules.oss.service.impl;

import java.util.Arrays;
import java.util.Map;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;

import io.xiaojl.xj2ee.common.kit.PageWrapper;
import io.xiaojl.xj2ee.kit.Query;
import io.xiaojl.xj2ee.modules.oss.entity.SysOssEntity;
import io.xiaojl.xj2ee.modules.oss.mapper.SysOssMapper;
import io.xiaojl.xj2ee.modules.oss.service.SysOssService;


@Service("sysOssService")
public class SysOssServiceImpl extends ServiceImpl<SysOssMapper, SysOssEntity> implements SysOssService {

	@Override
	public PageWrapper<SysOssEntity> queryPage(Map<String, Object> params) {
		Page<SysOssEntity> page = this.selectPage(
				new Query<SysOssEntity>(params).getPage()
		);

		PageWrapper<SysOssEntity> pw = new PageWrapper<>(params);
        pw.setList(page.getRecords());
        pw.setTotalCount(page.getTotal());
        pw.setTotalPage(Integer.parseInt(page.getPages()+""));
        return pw;
	}

	@Override
	public int deleteBatchIds(Long[] ids) {
		return baseMapper.deleteBatchIds(Arrays.asList(ids));
	}
	
}
